<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>兑换记录</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav fs_xl">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">兑换记录</h1>
		</header>
		<div class="nav_bt fs_xl">
			<a href="{:U('Mobile/exchange/exchange_list')}">我要兑换,立即前往</a>
		</div>
		<div class="mui-content fs_xl" style="background: #f4f4f4;">
			<div class="dh_jl active">
				<ul>
					<volist name="exchange_record"  id="vo">
						<if $vo.order_status == 2>
							<li class="fs_xl">
								<div class="dh_bb cls">
									<div class="dh_img fs_xl">
										<div><img src="{$vo.original_img}" /></div>
									</div>
									<div class="dh_txt">
										<p class="dh_p fs_l">{$vo.goods_name}</p>
										<p class="dh_pri fs_s cls"><span class="fs_xl">{$vo.exchange_integral}</span>银酒币<span class="fs_xs">成功兑换{$vo.num}瓶</span></p>
										<p class="dh_num fs_xs cls"><span class="fs_xs">{$vo.addtime|date="Y-m-d H:i",###}</span><span class="fs_m">-{$vo.total_amount}<em class="fs_xs">银酒币</em></span></p>
										<span class="dh_sus"><img src="__STATIC__/images/scs.png" /></span>
									</div>
								</div>
								<div class="dh_bot fs_xl">
									<a class="fs_m" href="{:U('/mobile/exchange/exchange_orderinfo',array('id'=>$vo.goods_id))}">再次兑换</a>
									<a class="fs_m delete_record"  order_id="{$vo.id}">删除记录</a>
								</div>
							</li>
						<else />
							<li class="fs_xl">
								<div class="dh_bb cls">
									<div class="dh_img fs_xl">
										<div><img src="{$vo.original_img}" /></div>
									</div>
									<div class="dh_txt">
										<p class="dh_p fs_l">{$vo.goods_name}</p>
										<p class="dh_pri fs_s cls"><span class="fs_xl">{$vo.exchange_integral}</span>银酒币<span class="fs_xs">成功兑换{$vo.num}瓶</span></p>
										<p class="dh_num fs_xs cls"><span class="fs_xs">{$vo.addtime|date="Y-m-d H:i",###}</span><span class="fs_m">-{$vo.total_amount}<em class="fs_xs">银酒币</em></span></p>
									</div>
								</div>
								<div class="dh_bot fs_xl">
									<a class="fs_m btn_ok" order_id="{$vo.id}" >确认收货</a>
									<a class="fs_m shipping" order_id="{$vo.id}" >查看物流</a>
								</div>
							</li>
						</if>
					</volist>
				</ul>
			</div>
		</div>
	</body>

	<script type="text/javascript">
		$(function(){
			$(".btn_ok").click(function(){
				var order_id = $(this).attr("order_id");
				$.ajax({
					type:'POST',
					url:"/mobile/exchange/exchange_record",
					data:{"order_id":order_id,"type":1},
					dataType:"json",
					success:function(data){
						alert(data.msg);
						location.reload();
					}
				});
			});
			$(".shipping").click(function(){
				alert(2);
			});
			$(".delete_record").click(function(){
				var order_id = $(this).attr("order_id");
				$.ajax({
					type:'POST',
					url:"/mobile/exchange/exchange_record",
					data:{"order_id":order_id,"type":2},
					dataType:"json",
					success:function(data){
						alert(data.msg);
						location.reload();
					}
				});
			});
		});
	</script>
</html>